<?php

namespace Symfony2u\AdminBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use \Symfony2u\CoreBundle\Form\ItemTypeType;
use \Symfony2u\CoreBundle\Entity\ItemType;

class ItemTypesController extends Controller
{
    /**
     * @Route("/")
     */
    public function indexAction()
    {
        return new Response('test');
    }
    
    /**
     * @Route("/add_new")
     * @Template()
     */
    public function addNewAction()
    {
        $item_type = new ItemType();
        $form = $this->createForm(new ItemTypeType(), $item_type);
        return array('form' => $form->createView());
    }
}
